layui.use(['layer','form'], function(){
	var form = layui.form,
	layer = layui.layer,
	$ = layui.$;
	/*@表单验证*/
	form.verify({
		describes: function(value){
			if(value == ''){
				return '描述不能为空';
			}
		},
	});
	/*@表单提交*/
	callback = function (data){
		$.post('/repair/fault/add',data.field,function(msg){
            if(msg.code === 1){
            	layer.alert(msg.msg, {icon: 1},function(index){
            		xadmin.close();
            		xadmin.father_reload();
            	})
            }else{
            	layer.msg(msg.msg, {icon: 5, time: 1000})
            }
        })
	}
	form.on('submit(baocun)',callback);
	

})